home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / GREETING.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  626b  |  18 lines

  1. ' GREETING.BAS
  2. ' This program demonstrates the LTRIM$ and RTRIM$ functions.
  3.  
  4. DIM firstName AS STRING * 12  ' declare fixed-length strings
  5. DIM lastName AS STRING * 15
  6.  
  7. CLS
  8.                               ' get first and last names
  9. INPUT "Enter your first name:  ", firstName
  10. INPUT "Enter your last name:  ", lastName
  11.  
  12. PRINT                         ' print greeting without trimming
  13. PRINT "Nice to meet you, "; firstName; " "; lastName; "!"
  14.                               ' print compliment with trimming
  15. PRINT "I think "; LTRIM$(RTRIM$(firstName)); " ";
  16. PRINT LTRIM$(RTRIM$(lastName)); " has a nice ring to it."
  17.  
  18.